﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VoiceAI;
using VoiceAI.VoiceResponse;
using Xiaowei.Services;

namespace Xiaowei.ResponseHandlers
{
    public static class WarrantyResponseHandler
    {
        public static void Handle(IResponseData responseData)
        {
            if (responseData is IWarrantyResponseData warrantyResponseData)
            {
                if (/*SystemState.IsLocked*/false)
                {
                    warrantyResponseData.ResponseText = "锁屏模式无法查看设备信息,可以进入桌面后查看。";
                    warrantyResponseData.TTSUrl = XiaoweiAI.Instance.RequestTTS("锁屏模式无法查看设备信息,可以进入桌面后查看。");
                }
                else
                {
                    warrantyResponseData.ResponseText = "小微正在为您查询中，请稍后……";
                    warrantyResponseData.TTSUrl = XiaoweiAI.Instance.RequestTTS("小微正在为您查询中，请稍后……");
                }
                var model = new Models.WarrantyModel();
                model.FetchWarrantyMessage();
                warrantyResponseData.DataContext = model;
            }
            DefaultResponseHandler.Handle(responseData);
        }
    }
}
